<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<input type="hidden" id="id" name="id">
			<div class='form-group'>
				<label class='col-md-2 control-label'>deptid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='deptid' type='text' name='deptid' id='deptid' data-bv-notempty='true' data-bv-notempty-message='deptid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>hostcode</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='hostcode' type='text' name='hostcode' id='hostcode' data-bv-notempty='true' data-bv-notempty-message='hostcode 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>code</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='code' type='text' name='code' id='code' data-bv-notempty='true' data-bv-notempty-message='code 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>name</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='name' type='text' name='name' id='name' data-bv-notempty='true' data-bv-notempty-message='name 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>remark</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='remark' type='text' name='remark' id='remark' data-bv-notempty='true' data-bv-notempty-message='remark 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>descs</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='descs' type='text' name='descs' id='descs' data-bv-notempty='true' data-bv-notempty-message='descs 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>address</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='address' type='text' name='address' id='address' data-bv-notempty='true' data-bv-notempty-message='address 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>itemname</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='itemname' type='text' name='itemname' id='itemname' data-bv-notempty='true' data-bv-notempty-message='itemname 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>resultdatetime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='resultdatetime' type='text' name='resultdatetime' id='resultdatetime' data-bv-notempty='true' data-bv-notempty-message='resultdatetime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>result</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='result' type='text' name='result' id='result' data-bv-notempty='true' data-bv-notempty-message='result 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>abnormalindicator</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='abnormalindicator' type='text' name='abnormalindicator' id='abnormalindicator' data-bv-notempty='true' data-bv-notempty-message='abnormalindicator 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>units</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='units' type='text' name='units' id='units' data-bv-notempty='true' data-bv-notempty-message='units 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>reference</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='reference' type='text' name='reference' id='reference' data-bv-notempty='true' data-bv-notempty-message='reference 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>patientname</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='patientname' type='text' name='patientname' id='patientname' data-bv-notempty='true' data-bv-notempty-message='patientname 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>jyitem</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='jyitem' type='text' name='jyitem' id='jyitem' data-bv-notempty='true' data-bv-notempty-message='jyitem 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>jytype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='jytype' type='text' name='jytype' id='jytype' data-bv-notempty='true' data-bv-notempty-message='jytype 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>cytime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='cytime' type='text' name='cytime' id='cytime' data-bv-notempty='true' data-bv-notempty-message='cytime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>sqdoctor</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='sqdoctor' type='text' name='sqdoctor' id='sqdoctor' data-bv-notempty='true' data-bv-notempty-message='sqdoctor 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>diago</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='diago' type='text' name='diago' id='diago' data-bv-notempty='true' data-bv-notempty-message='diago 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>jydoctor</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='jydoctor' type='text' name='jydoctor' id='jydoctor' data-bv-notempty='true' data-bv-notempty-message='jydoctor 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>checkdoct</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='checkdoct' type='text' name='checkdoct' id='checkdoct' data-bv-notempty='true' data-bv-notempty-message='checkdoct 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>cardno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='cardno' type='text' name='cardno' id='cardno' data-bv-notempty='true' data-bv-notempty-message='cardno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>cardtype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='cardtype' type='text' name='cardtype' id='cardtype' data-bv-notempty='true' data-bv-notempty-message='cardtype 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>idcard</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='idcard' type='text' name='idcard' id='idcard' data-bv-notempty='true' data-bv-notempty-message='idcard 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>idcardtype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='idcardtype' type='text' name='idcardtype' id='idcardtype' data-bv-notempty='true' data-bv-notempty-message='idcardtype 不能为空'>
				</div>
			</div>



			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='appReportlabList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="update()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		initData();
		
		function initData(){
			var id = getUrlParam("id");
			if(id != ""){
				$.ajax({
					type : 'get',
					url : '/appReportlabs/'+id,
					async : false,
					success : function(data) {
						$('#deptid').val(data.deptid);
						$('#hostcode').val(data.hostcode);
						$('#code').val(data.code);
						$('#name').val(data.name);
						$('#remark').val(data.remark);
						$('#descs').val(data.descs);
						$('#address').val(data.address);
						$('#itemname').val(data.itemname);
						$('#resultdatetime').val(data.resultdatetime);
						$('#result').val(data.result);
						$('#abnormalindicator').val(data.abnormalindicator);
						$('#units').val(data.units);
						$('#reference').val(data.reference);
						$('#patientname').val(data.patientname);
						$('#jyitem').val(data.jyitem);
						$('#jytype').val(data.jytype);
						$('#cytime').val(data.cytime);
						$('#sqdoctor').val(data.sqdoctor);
						$('#diago').val(data.diago);
						$('#jydoctor').val(data.jydoctor);
						$('#checkdoct').val(data.checkdoct);
						$('#cardno').val(data.cardno);
						$('#cardtype').val(data.cardtype);
						$('#idcard').val(data.idcard);
						$('#idcardtype').val(data.idcardtype);

					}
				});
			}
		}

		function update() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'put',
				url : '/appReportlabs',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("修改成功", {shift: -1, time: 1000}, function(){
                        location.href = "appReportlabList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
